home *** CD-ROM | disk | FTP | other *** search
-
- $Id: kick.readme 1.12 2003/07/15 20:38:31 wepl Exp $
-
- Symbols in the Slave-Source
- ***************************
-
- There are two classes of Symbols to define in the Slave-Source. The first
- class must be specified to setup essential informations for the system. The
- second class contains optional Symbols changing some behaviors of the
- emulation.
-
- Additional there are required flags in the ws_Flags field of the WHDLoadSlave
- structure. The flag WHDLF_EmulPriv must be always set because the exec
- function Supervisor requires it to change from user-mode into supervisor-mode.
- The flag WHDLF_Examine is only required if the file system handler (see
- HDINIT) is used.
-
-
- Required Symbols
- ----------------
-
- CHIPMEMSIZE = $80000
-
- That specfies the amount of Chip-Memory for the system. Allowed values are
- between $1000 and $200000. It is recommended to start with a full value like
- $80000 or $100000, and later to adjust that value to the minimum required
- using the MEMFREE feature (see below).
-
- FASTMEMSIZE = $10000
-
- That specifies the Fast-Memory (better to say ExpMem because it can be ChipMem
- too if not enough FastMem is available) for the system. Allowed values are
- 0 upto any what WHDLoad supports.
-
- NUMDRIVES = 1
-
- That sets the number of drives which will get detected by the emulated system.
- The amount has nothing to do with the amount of physically available drives!
- Allowed values are -1 ... 4. The value -1 has special meaning that Custom1/N
- is used to set drive count. If Custom1/N is not specified (its zero) than one
- drive will be used. Setting the drivecount to 0 works only with Kickstart 3.1,
- the older Kickstarts 1.2 and 1.3 will crash if there is no floppy drive.
-
- WPDRIVES = %0000
-
- That sets the protections state for the emulated floppy drives. Bit #0 means
- drive DF0: and the bitvalue 0 means 'write protected' and 1 means
- 'read/write'. E.g. %1111 means all drives 'read/write'.
-
-
- Optional Symbols
- ----------------
-
- BLACKSCREEN
-
- That symbol forces all colors (0-4,17-19) in the default system (intuition)
- preferences to null. The result is that the initial AmigaDOS boot screen will
- be invisible.
-
- CACHE
-
- The presence of that symbol enables full cpu caches for the expansion memory
- before the kickstart is booting. That gives best performance for the installed
- program. Chip memory remains uncached.
-
- DEBUG
-
- If that symbol is defined various checks will be included in the emulation
- code. It should be enabled during the development task and removed for final
- releases.
-
- DISKSONBOOT
-
- If that symbol is defined there will be disks inserted in the drives at
- booting time. Otherwise all drives will be empty. If the symbol is set, DF0:
- will contain 'Disk.1', DF1: 'Disk.2' an so on. To insert or change disks in
- the drives use the function _trd_changedisk (see below).
-
- DOSASSIGN
-
- If that symbol is defined the subroutine _dos_assign will be included and can
- be used (see below).
-
- FONTHEIGHT
-
- If defined that symbol sets the system default font height in the preferences
- (intuition), under Kick1.3 the default is 9 (60 chars per line), 8 makes 80
- chars per line on a standard screen.
-
- HDINIT
-
- If that symbol is defined a dos filesystem handler will be installed which
- mounts the actual directory as a drive called DH0: (volume has name
- 'WHDLoad'). If there is no bootable disk inserted (check DISKSONBOOT) the
- dos.library will try to boot from that device. HDINIT requires that the flag
- WHDLF_Examine to be set!
-
- HRTMON
-
- The presence of that symbol adds some debugging support for HrtMon. HrtMon
- reads to much from the stackframe if entered. If the SSP is at the end of the
- memory that will cause an access fault. The symbol results in a decremented
- SSP.
-
- IOCACHE = 1024
-
- If the symbol is defined it enables a read/write cache in conjuction with
- option HDINIT. The cache will be allocated on request for each opened file
- seperately. If the installed program uses savegames you should probably set
- the IOCACHE to the size of the savegame (or at least half/quarter) to minimize
- the amount OS swaps. If you use large values you maybe need to increase the
- memory for the installed program.
-
- INITAGA
-
- Only available in kick31.s. Enables the AGA graphics modes using
- gfx.SetChipRev(SETCHIPREV_BEST).
-
- INIT_AUDIO
-
- Only available in kick31.s. Forces the kickstart to initialize the
- audio.device.
-
- INIT_GADTOOLS
-
- Only available in kick31.s. Forces the kickstart to initialize the
- gadtools.library.
-
- INIT_MATHFFP
-
- Only available in kick31.s. Forces the kickstart to initialize the
- mathffp.library.
-
- MEMFREE = $100
-
- If this symbol is defined the function exec.AllocMem will be patched. At each
- call to this function the size of the largest free memory chunk will be
- calculated and saved at the specified address if lower than the previous one.
- Using this feature it is absolutely simple to optimize the memory requirements
- and avoid memory wasting. Test a game trough all paths with that symbol
- defined. Then make a dump and checkout the memory dump file. At address
- (MEMFREE) you will find the lowest free chip memory during the games lifetime.
- At address (MEMFREE+4) you will find the same for fast memory.
- The MEMFREE has also the side effect that trashing the memory list will be
- detected on the next AllocMem call because AvailMem(LARGEST) used in MEMFREE
- will traverse all free memory. This may be useful for debugging.
-
- NEEDFPU
-
- If that symbol is defined the system will get informed if an FPU is preset
- (execbase.AttnFlags). If the symbol is not defined the system will think there
- is no FPU regardless if there is one really. The system will use a different
- task switching routine which will save also the FPU registers if a FPU is
- present.
-
- POINTERTICKS
-
- If defined that symbol sets the system default mouse speed in the preferences
- (intuition). The system default is 2. Setting 1 means fast, 4 slow.
-
- SETPATCH
-
- If that symbol is defined nearly all patches done by the SetPatch v1.38
- program will be performed. Usually that is not necessary and omitting the
- option makes the Slave around 400 bytes shorter. Only available in kick12.s
- and kick13.s.
-
- STACKSIZE
-
- Using this symbol the default stacksize can be set. The initial CLI structure
- will be patched for this. The system default on V33 and V34 is 4000 bytes, on
- V40 it's 4096 bytes.
-
- TRDCHANGEDISK
-
- If that symbol is defined the subroutine _trd_changedisk will be included and
- can be used (see below).
-
-
- Labels in the Slave-Source
- **************************
-
- In the old style Slaves it was sufficient to only define the labels below.
- Beginning with the new style and WHDLoad v16 the kicknn.s will be included at
- the top of the slave source which results in that these labels are not visible
- to kicknn.s in the first assembling pass. This can cause problems with your
- assembler (e.g. "Internal Global Optimize Error" with BASM). To aid this you
- must define an uppercase symbol without the underlines (e.g. BOOTEARLY for
- _bootearly) before including kicknn.s in your slave source (see examples).
-
- _bootearly
-
- * will be entered before any diskaccess are performed by the Kickstart
- * NO dos.library exists at this time!
- * you can continue the boot process by returning via a RTS
-
- _bootblock
-
- * will be entered after the bootblock has been loaded from the disk in
- drive DF0:, that is the point at which Kickstart normally jumps into
- bootblock
- * Registers upon calling:
- A1 = ioreq, initialized to access trackdisk.device unit 0
- A0/A4 = buffer, containing the already loaded bootblock (1024 bytes)
- on Kick 1.2/1.3 its A4 on Kick 3.1 its A0
- A6 = execbase
- * NO dos.library exists at this time!
- * you can continue the boot process by returning via a RTS
-
- _bootdos
-
- * that label will called like a program located in the startup-
- sequence, that means it is a real CLI process, input and output
- streams are connected to the initial CLI window
- * dos.library is fully initialized and usable
- * the routine behind the label may return via a RTS, then the control
- is returned to the dos.library and the prompt will appear in the
- initial CLI window
- * _bootdos requires option HDINIT, because it uses a virtual
- startup-sequence and a virtual program loaded from within
-
- _cb_dosLoadSeg
-
- * that label will be called after each successful execution of
- dos.LoadSeg and can be used to patch the loaded programs
- * Registers upon calling:
- D0 = BSTR name of the loaded program as BCPL string
- D1 = BPTR segment list of the loaded program as BCPL pointer
- * the routine may destroy all registers but must return via RTS
-
- _cb_dosRead
-
- * works only in conjunction with HDINIT
- * that label will be called after each successful execution of
- dos.Read and can be used to patch the loaded data
- * Registers upon calling:
- D0 = ULONG amount of bytes read during current Read
- D1 = ULONG offset in file on start of current Read
- A0 = CPTR full name of file
- A1 = APTR buffer to the data has been read
- * the routine may destroy all registers but must return via RTS
-
- Functions in kick(12|13|31).s
- *****************************
-
- _dos_assign
- * only avaliable if DOSASSIGN is defined
- * performs a C:Assign like operation
- * SYNOPSIS
- IN: A0 = CPTR destination name
- A1 = CPTR directory (can be 0 meaning SYS:)
- OUT: -
- * only under kick12/13.s you may also assign device names to a
- directory!
- * EXAMPLE
- lea (_name,pc),a0
- sub.l a1,a1
- bsr _dos_assign
- ...
- _name dc.b "DataDisk",0
-
- _trd_changedisk
- * only avaliable if TRDCHANGEDISK is defined
- * change a disk in a trackdisk.device unit
- * SYNOPSIS
- IN: D0 = BYTE unit
- D1 = BYTE number of disk image to insert
- OUT: -
- * will cause two diskchanges as usual, one for removing the old disk
- and one for inserting the new one
-
- _flushcache
- * flush cpu caches
- * all registers will preserved
-
-
- Labels in kick(12|13|31).s
- **************************
-
- _attnflags
- * a long word containing the exec.AttnFlags
- * EXAMPLE
- move.l (_attnflags,pc),d0
- btst #AFB_68020,d0
- beq ...
-
- _dosname
- * only avaliable if HDINIT is defined
- * containing "dos.library"
- * maybe used to open dos.library
-
- _monitor
- * a long word containing the actual monitor
- * EXAMPLE
- move.l (_monitor,pc),d0
- cmp.l #PAL_MONITOR_ID,d0
- beq ...
-
- _resload
- * containing resload base
-
-